package cn.yeyiu.sexyiu.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import androidx.fragment.app.Fragment;

import cn.yeyiu.sexyiu.R;
import cn.yeyiu.sexyiu.activity.DownloadActivity;
import cn.yeyiu.sexyiu.activity.Guess2Activity;
import cn.yeyiu.sexyiu.activity.SettingActivity;
import cn.yeyiu.sexyiu.activity.UserDataActivity;
import cn.yeyiu.util.ExternalJSONFile;

public class UserFragment extends Fragment {
    private LinearLayout favourLLayout;
    private LinearLayout recentLLayout;
    private LinearLayout downloadLLayout;
    private LinearLayout settingLLayout;
    private View guessView;

    @Override // androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate = layoutInflater.inflate(R.layout.fragment_user, viewGroup, false);
        viewInit(inflate);
        eventInit();
        return inflate;
    }

    /* access modifiers changed from: package-private */
    public void viewInit(View view) {
        this.favourLLayout = (LinearLayout) view.findViewById(R.id.like_layout);
        this.recentLLayout = (LinearLayout) view.findViewById(R.id.recent_layout);
        this.downloadLLayout = (LinearLayout) view.findViewById(R.id.download_layout);
        this.settingLLayout = (LinearLayout) view.findViewById(R.id.setting_layout);
        this.guessView = view.findViewById(R.id.user_img);
    }

    public void eventInit() {
        this.favourLLayout.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), UserDataActivity.class);
            intent.putExtra("type", ExternalJSONFile.favour);
            startActivity(intent);
        });
        this.recentLLayout.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), UserDataActivity.class);
            intent.putExtra("type", ExternalJSONFile.recent);
            startActivity(intent);
        });
        this.downloadLLayout.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), DownloadActivity.class);
            startActivity(intent);
        });
        this.settingLLayout.setOnClickListener(v->{
            Intent intent = new Intent(getActivity(), SettingActivity.class);
            startActivity(intent);
        });
        this.guessView.setOnClickListener(v->
            startActivity(new Intent(getActivity(), Guess2Activity.class))
        );
    }
}
